home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Dictionary.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  5.0 KB  |  196 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    Dictionary Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
  21. __DICTIONARY__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  30.     include 'Files.a'
  31.     ENDIF
  32. ;        include 'MixedMode.a'                                        ;
  33. ;        include 'OSUtils.a'                                        ;
  34. ;            include 'Memory.a'                                        ;
  35.  
  36. ; Dictionary data insertion modes 
  37. kInsert                            EQU        0                    ; Only insert the input entry if there is nothing in the dictionary that matches the key. 
  38. kReplace                        EQU        1                    ; Only replace the entries which match the key with the input entry. 
  39. kInsertOrReplace                EQU        2                    ; Insert the entry if there is nothing in the dictionary which matches the key. 
  40. ;                           If there is already matched entries, replace the existing matched entries with the input entry. 
  41.  
  42. ; This Was InsertMode 
  43. ; typedef short             DictionaryDataInsertMode
  44.  
  45. ; Key attribute constants 
  46. kIsCaseSensitive                EQU        $10                    ; case sensitive = 16        
  47. kIsNotDiacriticalSensitive        EQU        $20                    ; diac not sensitive = 32    
  48.  
  49. ; Registered attribute type constants.    
  50. kNoun                            EQU        -1
  51. kVerb                            EQU        -2
  52. kAdjective                        EQU        -3
  53. kAdverb                            EQU        -4
  54.  
  55. ; This Was AttributeType 
  56. ; typedef SInt8             DictionaryEntryAttribute
  57. ; Dictionary information record 
  58. DictionaryInformation     RECORD    0
  59. dictionaryFSSpec         ds     FSSpec    ; offset: $0 (0)
  60. numberOfRecords             ds.l   1        ; offset: $46 (70)
  61. currentGarbageSize         ds.l   1        ; offset: $4A (74)
  62. script                     ds.w   1        ; offset: $4E (78)
  63. maximumKeyLength         ds.w   1        ; offset: $50 (80)
  64. keyAttributes             ds.b   1        ; offset: $52 (82)
  65. filler                     ds.b   1        ; offset: $53 (83)
  66. sizeof                     EQU *            ; size:   $54 (84)
  67.                         ENDR
  68.  
  69. ; typedef struct DictionaryInformation  DictionaryInformation
  70. DictionaryAttributeTable RECORD    0
  71. datSize                     ds.b   1        ; offset: $0 (0)
  72. datTable                 ds.b   1        ; offset: $1 (1)
  73. sizeof                     EQU *            ; size:   $2 (2)
  74.                         ENDR
  75.  
  76. ; typedef struct DictionaryAttributeTable  DictionaryAttributeTable
  77. ; typedef DictionaryAttributeTable  *DictionaryAttributeTablePtr
  78. ;
  79. ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  80. ;
  81.     IF ¬ GENERATINGCFM THEN
  82.         Macro
  83.         _InitializeDictionary
  84.             move.w    #$0500,d0
  85.             dc.w     $AA53
  86.         EndM
  87.     ELSE
  88.         IMPORT_CFM_FUNCTION    InitializeDictionary
  89.     ENDIF
  90.  
  91. ;
  92. ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  93. ;
  94.     IF ¬ GENERATINGCFM THEN
  95.         Macro
  96.         _OpenDictionary
  97.             move.w    #$0501,d0
  98.             dc.w     $AA53
  99.         EndM
  100.     ELSE
  101.         IMPORT_CFM_FUNCTION    OpenDictionary
  102.     ENDIF
  103.  
  104. ;
  105. ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  106. ;
  107.     IF ¬ GENERATINGCFM THEN
  108.         Macro
  109.         _CloseDictionary
  110.             move.w    #$0202,d0
  111.             dc.w     $AA53
  112.         EndM
  113.     ELSE
  114.         IMPORT_CFM_FUNCTION    CloseDictionary
  115.     ENDIF
  116.  
  117. ;
  118. ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  119. ;
  120.     IF ¬ GENERATINGCFM THEN
  121.         Macro
  122.         _InsertRecordToDictionary
  123.             move.w    #$0703,d0
  124.             dc.w     $AA53
  125.         EndM
  126.     ELSE
  127.         IMPORT_CFM_FUNCTION    InsertRecordToDictionary
  128.     ENDIF
  129.  
  130. ;
  131. ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  132. ;
  133.     IF ¬ GENERATINGCFM THEN
  134.         Macro
  135.         _DeleteRecordFromDictionary
  136.             move.w    #$0404,d0
  137.             dc.w     $AA53
  138.         EndM
  139.     ELSE
  140.         IMPORT_CFM_FUNCTION    DeleteRecordFromDictionary
  141.     ENDIF
  142.  
  143. ;
  144. ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  145. ;
  146.     IF ¬ GENERATINGCFM THEN
  147.         Macro
  148.         _FindRecordInDictionary
  149.             move.w    #$0805,d0
  150.             dc.w     $AA53
  151.         EndM
  152.     ELSE
  153.         IMPORT_CFM_FUNCTION    FindRecordInDictionary
  154.     ENDIF
  155.  
  156. ;
  157. ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  158. ;
  159.     IF ¬ GENERATINGCFM THEN
  160.         Macro
  161.         _FindRecordByIndexInDictionary
  162.             move.w    #$0A06,d0
  163.             dc.w     $AA53
  164.         EndM
  165.     ELSE
  166.         IMPORT_CFM_FUNCTION    FindRecordByIndexInDictionary
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  171. ;
  172.     IF ¬ GENERATINGCFM THEN
  173.         Macro
  174.         _GetDictionaryInformation
  175.             move.w    #$0407,d0
  176.             dc.w     $AA53
  177.         EndM
  178.     ELSE
  179.         IMPORT_CFM_FUNCTION    GetDictionaryInformation
  180.     ENDIF
  181.  
  182. ;
  183. ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  184. ;
  185.     IF ¬ GENERATINGCFM THEN
  186.         Macro
  187.         _CompactDictionary
  188.             move.w    #$0208,d0
  189.             dc.w     $AA53
  190.         EndM
  191.     ELSE
  192.         IMPORT_CFM_FUNCTION    CompactDictionary
  193.     ENDIF
  194.  
  195.     ENDIF ; __DICTIONARY__
  196.